package com.job.landlord.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.job.common.entity.Role;
import com.job.common.entity.UserRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserRoleMapper extends BaseMapper<UserRole> {
    @Select("SELECT r.* FROM role r, user_role ur WHERE r.id = ur.role_id AND ur.user_id = #{id}")
    List<Role> getRolesByUserId(Long id);
}
